import { Modal } from "antd";
import React from "react";
import { SubTitle } from "../SubTitle";
import Style from "./index.module.less";
import DraggableModal from "@/views/components/CommonModal/DraggableModal";
/**
 * 公共弹窗组件
 */
export const CommonModal = props => {
	const { title, children, specWrapperStyle = {}, ...args } = props;
	return (
		<DraggableModal
			className={Style.modal}
			title={<div style={{overflow: 'hidden'}}><SubTitle as="s4" className={Style.title} {...title}/></div>}
			okButtonProps={{
				size: "middle"
			}}
			cancelButtonProps={{
				size: "middle"
			}}
			centered
			{...args}
		>
			<div className={Style.modal_content_wrap} style={{...specWrapperStyle}}>{children}</div>
		</DraggableModal>
	);
};
export default CommonModal;
